package com.tfjybj.itoo.exam.provider.service.impl;

import com.dmsdbj.itoo.tool.base.service.impl.BaseServicePlusImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tfjybj.itoo.exam.entity.TemplateDetailsCustomEntity;
import com.tfjybj.itoo.exam.model.TemplateDetailsModel;
import com.tfjybj.itoo.exam.provider.dao.TemplateDetailsCustomDao;
import com.tfjybj.itoo.exam.provider.service.TemplateDetailsCustomService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * TemplateDetailsCustomService接口实现类
 * ${base}表
 *
 * @author 任晓帅
 * @version 2.0.0
 * @since 2.0.0 2018-11-15 19:40:28
 */
@Service("templateDetailsCustomService")
public class TemplateDetailsCustomServiceImpl extends BaseServicePlusImpl<TemplateDetailsCustomDao, TemplateDetailsCustomEntity> implements TemplateDetailsCustomService {
	
	//region 模板生成
    @Resource
    private TemplateDetailsCustomDao templateDetailsCustomDao;

	 @Override
    public PageInfo<TemplateDetailsCustomEntity> queryByLikeQuestionClassifyId(String questionClassifyId, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(templateDetailsCustomDao.queryLikeQuestionClassifyId(questionClassifyId));
    }


    //endregion

    /* **********************************以下为非模板生成的内容********************************* */
    /**
     * 添加模板自定义
     * @param templateDetailsCustomEntity 模板自定义表
     * @author 杨海云
     * @since 2.0.0 2018年11月29日08:24:30
     */
    @Override
    public int installTemp(TemplateDetailsCustomEntity templateDetailsCustomEntity) {
         return this.templateDetailsCustomDao.insert(templateDetailsCustomEntity);
    }

    @Override
    public List<TemplateDetailsCustomEntity> findByDetailsId(String templateDetailsId){

        return templateDetailsCustomDao.findByDetailsId(templateDetailsId);
    }

    @Override
    public List<TemplateDetailsModel> queryTemDeCustomByTemDetailsId(String templateDetailsId){
        return templateDetailsCustomDao.queryTemDeCustomByTemDetailsId(templateDetailsId);
    }
}
